/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package EA_Model.IEC61970.StateVariables.impl;

import EA_Model.IEC61970.StateVariables.StateVariablesPackage;
import EA_Model.IEC61970.StateVariables.SvShuntCompensatorSections;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Sv Shunt Compensator Sections</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link EA_Model.IEC61970.StateVariables.impl.SvShuntCompensatorSectionsImpl#getContinuousSections <em>Continuous Sections</em>}</li>
 *   <li>{@link EA_Model.IEC61970.StateVariables.impl.SvShuntCompensatorSectionsImpl#getSections <em>Sections</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class SvShuntCompensatorSectionsImpl extends StateVariableImpl implements SvShuntCompensatorSections {
	/**
	 * The cached value of the '{@link #getContinuousSections() <em>Continuous Sections</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getContinuousSections()
	 * @generated
	 * @ordered
	 */
	protected EA_Model.IEC61970.Domain.Float continuousSections;

	/**
	 * The cached value of the '{@link #getSections() <em>Sections</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getSections()
	 * @generated
	 * @ordered
	 */
	protected EA_Model.IEC61970.Domain.Integer sections;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected SvShuntCompensatorSectionsImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return StateVariablesPackage.Literals.SV_SHUNT_COMPENSATOR_SECTIONS;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Float getContinuousSections() {
		if (continuousSections != null && continuousSections.eIsProxy()) {
			InternalEObject oldContinuousSections = (InternalEObject)continuousSections;
			continuousSections = (EA_Model.IEC61970.Domain.Float)eResolveProxy(oldContinuousSections);
			if (continuousSections != oldContinuousSections) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, StateVariablesPackage.SV_SHUNT_COMPENSATOR_SECTIONS__CONTINUOUS_SECTIONS, oldContinuousSections, continuousSections));
			}
		}
		return continuousSections;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Float basicGetContinuousSections() {
		return continuousSections;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setContinuousSections(EA_Model.IEC61970.Domain.Float newContinuousSections) {
		EA_Model.IEC61970.Domain.Float oldContinuousSections = continuousSections;
		continuousSections = newContinuousSections;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, StateVariablesPackage.SV_SHUNT_COMPENSATOR_SECTIONS__CONTINUOUS_SECTIONS, oldContinuousSections, continuousSections));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Integer getSections() {
		if (sections != null && sections.eIsProxy()) {
			InternalEObject oldSections = (InternalEObject)sections;
			sections = (EA_Model.IEC61970.Domain.Integer)eResolveProxy(oldSections);
			if (sections != oldSections) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, StateVariablesPackage.SV_SHUNT_COMPENSATOR_SECTIONS__SECTIONS, oldSections, sections));
			}
		}
		return sections;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Integer basicGetSections() {
		return sections;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setSections(EA_Model.IEC61970.Domain.Integer newSections) {
		EA_Model.IEC61970.Domain.Integer oldSections = sections;
		sections = newSections;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, StateVariablesPackage.SV_SHUNT_COMPENSATOR_SECTIONS__SECTIONS, oldSections, sections));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case StateVariablesPackage.SV_SHUNT_COMPENSATOR_SECTIONS__CONTINUOUS_SECTIONS:
				if (resolve) return getContinuousSections();
				return basicGetContinuousSections();
			case StateVariablesPackage.SV_SHUNT_COMPENSATOR_SECTIONS__SECTIONS:
				if (resolve) return getSections();
				return basicGetSections();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case StateVariablesPackage.SV_SHUNT_COMPENSATOR_SECTIONS__CONTINUOUS_SECTIONS:
				setContinuousSections((EA_Model.IEC61970.Domain.Float)newValue);
				return;
			case StateVariablesPackage.SV_SHUNT_COMPENSATOR_SECTIONS__SECTIONS:
				setSections((EA_Model.IEC61970.Domain.Integer)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case StateVariablesPackage.SV_SHUNT_COMPENSATOR_SECTIONS__CONTINUOUS_SECTIONS:
				setContinuousSections((EA_Model.IEC61970.Domain.Float)null);
				return;
			case StateVariablesPackage.SV_SHUNT_COMPENSATOR_SECTIONS__SECTIONS:
				setSections((EA_Model.IEC61970.Domain.Integer)null);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case StateVariablesPackage.SV_SHUNT_COMPENSATOR_SECTIONS__CONTINUOUS_SECTIONS:
				return continuousSections != null;
			case StateVariablesPackage.SV_SHUNT_COMPENSATOR_SECTIONS__SECTIONS:
				return sections != null;
		}
		return super.eIsSet(featureID);
	}

} //SvShuntCompensatorSectionsImpl
